//
//  BaseViewController.swift
//  LGMusic
//
//  Created by 梁尚嘉 on 2017/3/22.
//  Copyright © 2017年 LimeGah. All rights reserved.
//

import UIKit
import SnapKit


class BaseViewController: UIViewController {

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        UIApplication.shared.setStatusBarStyle(UIStatusBarStyle.lightContent, animated: false)
    }


    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        // Do any additional setup after loading the view.
        if self.navigationController != nil && (self.navigationController?.viewControllers.count)!>1 {
            self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(image: UIImage.init(named: "btn_back_black"), style: UIBarButtonItemStyle.plain, target: self, action: #selector(BaseViewController.backAction))
        }

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func backAction() {
        debugPrint(self.navigationController?.popViewController(animated: true)?.title ?? "no title")
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
